package com.itheima.course.design.service;

import com.itheima.course.design.dao.EnrollmentDao;
import com.itheima.course.design.entity.Enrollment;

import java.util.List;

public class EnrollmentService {
    private EnrollmentDao enrollmentDao = new EnrollmentDao();

    // 获取学生的所有选课记录
    public List<Enrollment> getEnrollmentsByStudentId(String studentId) {
        return enrollmentDao.getEnrollmentsByStudentId(studentId);
    }

    // 添加选课记录
    public boolean addEnrollment(Enrollment enrollment) {
        return enrollmentDao.addEnrollment(enrollment);
    }

    // 退选课程
    public boolean deleteEnrollment(String studentId, String courseCode) {
        return enrollmentDao.deleteEnrollment(studentId, courseCode);
    }
}